﻿using IOC.Domain;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IOC.Console
{
    class Program
    {
        static void Main(string[] args)
        {

            var container = new UnityContainer();//创建DI容器
            container.LoadConfiguration("Game");//加载DI配置

            var play = container.Resolve<IPlay>();

            play.PhoneGame.Install();

            #region Unity 示例代码
            //var container = new UnityContainer();//创建DI容器
            //container.RegisterType<IGame, MobaGame>();//注入
            //container.RegisterType<IPlay, Phone>();//注入

            //var play = container.Resolve<IPlay>();
            //play.PhoneGame.DoPlay();
            #endregion

            System.Console.ReadKey();
        }
    }
}
